<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateYaoUserPostLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('yao_user_post_logs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('request_url')->default('')->comment('请求地址');
            $table->text('payload')     ->nullable()   ->comment('请求参数');
            $table->text('response')    ->nullable()          ->comment('返回结果');
            $table->integer('http_code')->default(0)    ->comment('http请求状态码');
            $table->tinyInteger('is_success')->default(0)->comment('操作是否成功');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('yao_user_post_logs');
    }
}
